# 生成名为MathFunctions的静态库
add_library(MathFunctions MathFunc.cpp)

#INTERFACE means things that consumers require but the producer doesn’t
#如果有这句，在顶层的CMakeLists.txt就可以不用include了。参见CMakeLists4.txt。可以对比CMakeLists3.txt
target_include_directories(MathFunctions INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

#如果有下面的表示cmake安装。参考顶层CMakeLists5.txt
install(TARGETS MathFunctions DESTINATION lib)
install(FILES MathFunc.h DESTINATION include)